﻿using EMSClient.Config;
using HYRN.Common.ConvertUtilities;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EMSClient.CForm
{
    public partial class FormSysConfig : Form
    {
        public FormSysConfig()
        {
            InitializeComponent();
        }

        private void FormSysConfig_Load(object sender, EventArgs e)
        {
            tb_IP.Text = EmsConfigHelper.IP;
            numericUpDown1.Value = EmsConfigHelper.Port;

            textBox1.Text = EmsConfigHelper.LoginName;
            textBox2.Text = EmsConfigHelper.LoginPwd;
        }

        private void ucBtnExt21_BtnClick(object sender, EventArgs e)
        {
            EmsConfigHelper.IP = tb_IP.Text;
            EmsConfigHelper.Port = numericUpDown1.Value.ObjToInt();

            textBox1.Text = EmsConfigHelper.LoginName;
            EmsConfigHelper.LoginPwd = textBox2.Text;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void ucBtnExt22_BtnClick(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
